home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 007a / 899track.zip / 899MAIN.PRO < prev    next >
Text File  |  1990-03-06  |  4KB  |  104 lines

  1. project "899"
  2. include "899glob.pro"
  3.  
  4. % 899MAIN.PRO -- Main Program front end interface (GOAL is here)
  5.  
  6. PREDICATES
  7.   initialize           % Initialization code
  8.   shutdown             % Shutdown code
  9.   mainmenu             % The main menu section
  10.   process(INTEGER)     % Main router
  11.   
  12. GOAL
  13.   initialize,
  14.   mainmenu,
  15.   shutdown.
  16.   
  17. CLAUSES
  18.   initialize :-
  19.       EditAttr = bright_white + b_blue,
  20.       EditFrameAttr = EditAttr,
  21.       makewindow(100,EditAttr,EditFrameAttr,edit_title,10,0,14,79,clear_window,
  22.                  center_title,double_line_frame),
  23.       makewindow(1,7,0,"Dos Coverup Window",0,0,24,79),
  24.       write("Reading Label Data file...please wait"),
  25.       openbase,
  26.       clearwindow.
  27.   
  28.   shutdown :-
  29.       retract(datamodified),   % Try to remove -- may fail
  30.       write("Saving Changed Data\n"),
  31.       clbase,
  32.       fail.
  33.   shutdown :-
  34.       removewindow, removewindow.
  35.       
  36.   mainmenu :-
  37.       Attr = b_black + yellow,
  38.       FrameAttr = Attr,
  39.       Row = 2,
  40.       Column = 3,
  41.       Height = 20,
  42.       Width = 76,
  43.       makewindow(2,Attr,FrameAttr," WTHS Music Director's Rasta List ",
  44.                  Row, Column, Height, Width, clear_window,
  45.                  center_title, double_line_frame),
  46.       repeat,
  47.         clearwindow,
  48.         write("\n\n",
  49.               "\t1) Add Data to Label File.\n\n",
  50.               "\t2) Kill Useless data in Label File.\n\n",
  51.               "\t3) Modify Some particular item in Label File.\n\n",
  52.               "\t4) Print Mailing Labels (As addresses in label form).\n\n",
  53.               "\t5) Print Simple List of Data In Label File.\n\n",
  54.               "\t6) EXIT PROGRAM.\n\n\n\t\t"),
  55.         getIntOpt(1,6,Choice),
  56.         process(Choice),
  57.       Choice = 6, !,
  58.       removewindow.
  59.  
  60.   process(1) :- !,  % Add Data to label file
  61.       modspecs(label([],"",[],"","","","",[]),Q),
  62.       Q = label(Cats,Lab,Addr,City,State,Zip,Phone,Comments),
  63.       assertz(label(Cats,Lab,Addr,City,State,Zip,Phone,Comments)),
  64.       modifdat.  % Toggle
  65.   process(2) :- !,  % Kill Useless data
  66.       clearwindow,
  67.       cursor(0,0),
  68.       write("Building Choice menu...please wait\n"),
  69.       getLabelNames(CvtList),
  70.       show_get(CvtList,ChoiceToDelete,""), !, /* Get the choice FAILS on ESC */
  71.       label(Cats,ChoiceToDelete,AddressInfo,City,State,ZIP,Phone,Comments), !,
  72.       clearwindow,
  73.     write("RECORD LABEL     : '",ChoiceToDelete,"'\n"),
  74.       write("CATEGORIES       :  ",Cats,'\n'),
  75.       write("ADDRESS INFO     :  ",AddressInfo,'\n'),
  76.       write("CITY, STATE  ZIP :  ",City,", ",State,"  ",ZIP,'\n'),
  77.       write("PHONE            :  ",Phone,'\n'),
  78.       write("COMMENTS --\n",Comments,'\n'),
  79.       write("\nDELETE This Record Label... are you SURE (Y/N)? "),
  80.       askyn, !,
  81.       retract(label(Cats,ChoiceToDelete,AddressInfo,City,State,ZIP,Phone,Comments)), !,
  82.       modifdat,
  83.       bep,
  84.       write("\n'",ChoiceToDelete,"' has been deleted from label list.\n"),
  85.       wait.
  86.   process(3) :- !,  % Modify Some item
  87.       clearwindow,
  88.       cursor(0,0),
  89.       write("Building choice menu of selections for modification...."),
  90.       getLabelNames(CvtList),
  91.       show_get(CvtList,ChoiceToMod,""), !,
  92.       label(Cats,ChoiceToMod,Addr,City,State,Zip,Phone,Comments), !,
  93.       modspecs(label(Cats,ChoiceToMod,Addr,City,State,Zip,Phone,Comments),R),
  94.       retract(label(Cats,ChoiceToMod,Addr,City,State,Zip,Phone,Comments)), !,
  95.       R = label(Ncats,Nlab,Naddr,Ncity,Nstate,Nzip,Nphone,Ncomments),
  96.       assertz(label(Ncats,Nlab,Naddr,Ncity,Nstate,Nzip,Nphone,Ncomments)),
  97.       modifdat, !.
  98.   process(4) :- !,  % Print Mailing Labels
  99.       label_print.
  100.   process(5) :- !,  % Print Simple data list
  101.       sheet_print.
  102.   process(_).  % That is all!!
  103.  
  104.